import Router from 'koa-router';
import proxyService from '../../common/proxyService';
import {
  // getReceivableConfigurationInfo,
  // saveReceivableConfiguration,
  // 门店
  queryStoreByPage,
  createNewStore,
  deleteSotre,
  editStoreOrder,
  getSotreInfo,
  getMaxOrder,
  saveBusinessInfo,
  getBusinessInfo,
  storeUploadToken,
  // 订单管理
  getOrderBypage,
  getOrderInfo,
  getOrderActiveList,
  getOrderMoney,
  updateCorpOrderInfo,
  // 商品管理
  editorMerchandiseGroupName,
  changeMerchandiseGroupOrder,
  deleteMerchandiseGroup,
  getMerchandiseGroupList,
  getMerchandiseByPage,
  moveMerchandiseToGroup,
  removeMerchandise,
  deleteMerchandise,
  editorMerchandiseOrder,
  // editorMerchandise,
  // copyMerchandise,
  getUserShopGroups, //获取商品分组
  getMerchandiseActiveList,
  commitShopMessage, //添加商品
  getShopMessage, //获取商品信息
  getIdx, //获取排序值
  getPaymentConfigureInfoo, //获取支付配置信息
  updatePayConfigure, //更新支付配置
  getCodeParameter, //获取二维码参数
  getPayStatus, //获取支付状态
  addWxPayInfo, //添加微信支付配置信息
} from '../../api/admin_account';

const router = new Router();

// 获取默认免费信息
router.get('/getReceivableConfigurationInfo', async ctx => {
  // const response = await proxyService.postProxy(ctx, getReceivableConfigurationInfo);
  const response = await proxyService.mockData({
    code: 1,
    message: 'mock data success',
    data: {
      payOffLine: false,
      wxPay: false,
      storeName: '星客互联123',
      storeAccount: '634841322',
      appId: '5as65f464sa',
      key: 'IKeKjoQ8K2zh5L7ai3abhGKLF6PbvS3W',
    },
  });
  return (ctx.body = response);
});

// 获取默认免费信息
router.post('/saveReceivableConfiguration', async ctx => {
  // const response = await proxyService.postProxy(ctx, saveReceivableConfiguration);
  const response = await proxyService.mockData({
    code: 1,
    data: {},
    message: 'mock data success',
  });
  return (ctx.body = response);
});

// 查询门店列表
router.get('/queryStoreByPage', async ctx => {
  const response = await proxyService.postProxy(ctx, queryStoreByPage);
  return (ctx.body = response);
});

// 新建/修改门店
router.post('/createNewStore', async ctx => {
  const response = await proxyService.postProxy(ctx, createNewStore);
  return (ctx.body = response);
});

// 删除门店
router.post('/deleteSotre', async ctx => {
  const response = await proxyService.postProxy(ctx, deleteSotre);
  return (ctx.body = response);
});

router.post('/storeUploadToken', async ctx => {
  const response = await proxyService.postProxy(ctx, storeUploadToken);
  return (ctx.body = response);
});

// 新建门店排序
router.post('/editStoreOrder', async ctx => {
  const response = await proxyService.postProxy(ctx, editStoreOrder);
  return (ctx.body = response);
});

// 新建门店排序
router.get('/getMaxOrder', async ctx => {
  const response = await proxyService.postProxy(ctx, getMaxOrder);
  return (ctx.body = response);
});

// 新建商家介绍
router.post('/saveBusinessInfo', async ctx => {
  const response = await proxyService.postProxy(ctx, saveBusinessInfo);
  return (ctx.body = response);
});
// 获取店铺详情
router.get('/getSotreInfo', async ctx => {
  const response = await proxyService.postProxy(ctx, getSotreInfo);
  return (ctx.body = response);
});
// 获取商家介绍
router.get('/getBusinessInfo', async ctx => {
  const response = await proxyService.postProxy(ctx, getBusinessInfo);
  return (ctx.body = response);
});
// 查询订单管理列表
router.get('/getOrderBypage', async ctx => {
  const response = await proxyService.postProxy(ctx, getOrderBypage);
  return (ctx.body = response);
});

// 查询订单管理详情
router.get('/getOrderInfo', async ctx => {
  const response = await proxyService.postProxy(ctx, getOrderInfo);
  return (ctx.body = response);
});
// 查询订单活动呢List
router.get('/getOrderActiveList', async ctx => {
  const response = await proxyService.postProxy(ctx, getOrderActiveList);
  return (ctx.body = response);
});
// 订单金额信息
router.get('/getOrderMoney', async ctx => {
  const response = await proxyService.postProxy(ctx, getOrderMoney);
  return (ctx.body = response);
});

router.post('/updateCorpOrderInfo', async ctx => {
  const response = await proxyService.postProxy(ctx, updateCorpOrderInfo);
  return (ctx.body = response);
});
// 新建/修改分组名
router.post('/editorMerchandiseGroupName', async ctx => {
  const response = await proxyService.postProxy(ctx, editorMerchandiseGroupName);
  return (ctx.body = response);
});
// 移动商品分组
router.post('/changeMerchandiseGroupOrder', async ctx => {
  const response = await proxyService.postProxy(ctx, changeMerchandiseGroupOrder);
  return (ctx.body = response);
});
// 删除商品分组
router.post('/deleteMerchandiseGroup', async ctx => {
  const response = await proxyService.postProxy(ctx, deleteMerchandiseGroup);
  return (ctx.body = response);
});
// 查询商品分组
router.get('/getMerchandiseGroupList', async ctx => {
  const response = await proxyService.postProxy(ctx, getMerchandiseGroupList);
  return (ctx.body = response);
});
// 查询分组商品列表
router.get('/getMerchandiseByPage', async ctx => {
  const response = await proxyService.postProxy(ctx, getMerchandiseByPage);
  return (ctx.body = response);
});
// 移动商品到指定分组
router.post('/moveMerchandiseToGroup', async ctx => {
  const response = await proxyService.postProxy(ctx, moveMerchandiseToGroup);
  return (ctx.body = response);
});
// 商品下架
router.post('/removeMerchandise', async ctx => {
  const response = await proxyService.postProxy(ctx, removeMerchandise);
  return (ctx.body = response);
});
// 删除商品
router.post('/deleteMerchandise', async ctx => {
  const response = await proxyService.postProxy(ctx, deleteMerchandise);
  return (ctx.body = response);
});
// 修改商品排序
router.post('/editorMerchandiseOrder', async ctx => {
  const response = await proxyService.postProxy(ctx, editorMerchandiseOrder);
  return (ctx.body = response);
});
//修改商品 放弃接口
router.post('/editorMerchandise', async ctx => {
  const response = await proxyService.mockData({
    code: 1,
    data: {},
    message: 'mock data success',
  });
  return (ctx.body = response);
});
// 复制商品 放弃接口
router.post('/copyMerchandise', async ctx => {
  // const response = await proxyService.postProxy(ctx, copyMerchandise);
  const response = await proxyService.mockData({
    code: 1,
    data: {},
    message: 'mock data success',
  });
  return (ctx.body = response);
});

// 获取商品类目
router.get('/getMerchandiseActiveList', async ctx => {
  const response = await proxyService.postProxy(ctx, getMerchandiseActiveList);
  return (ctx.body = response);
});

//获取用户商品分组
router.get('/getUserShopGroups', async ctx => {
  const response = await proxyService.postProxy(ctx, getUserShopGroups);
  return (ctx.body = response);
});

//保存商品信息
router.post('/commitShopMessage', async ctx => {
  const response = await proxyService.postProxy(ctx, commitShopMessage);
  return (ctx.body = response);
});

//获取商品信息
router.get('/getShopMessage', async ctx => {
  const response = await proxyService.postProxy(ctx, getShopMessage);
  return (ctx.body = response);
});
//获取排序值
router.get('/getIdx', async ctx => {
  const response = await proxyService.postProxy(ctx, getIdx);
  return (ctx.body = response);
});
//获取支付配置信息
router.get('/getPaymentConfigureInfo', async ctx => {
  // console.log(ctx)
  const response = await proxyService.postProxy(ctx, getPaymentConfigureInfoo);
  return (ctx.body = response);
});
//更新支付配置
router.get('/updatePayConfigure', async ctx => {
  const response = await proxyService.postProxy(ctx, updatePayConfigure);
  return (ctx.body = response);
});
//获取二维码参数
router.post('/getCodeParameter', async ctx => {
  // console.log('ctx', ctx);
  const response = await proxyService.postProxy(ctx, getCodeParameter);
  return (ctx.body = response);
});
//获取支付状态
router.post('/getPayStatus', async ctx => {
  // console.log('ctx', ctx);
  const response = await proxyService.postProxy(ctx, getPayStatus);
  return (ctx.body = response);
});
//添加微信支付配置信息
router.post('/addWxPayInfo', async ctx => {
  const response = await proxyService.postProxy(ctx, addWxPayInfo);
  return (ctx.body = response);
});

export default router;
